﻿using System;

namespace diantou.web.enterprise
{
    /// <summary>
    /// 工作职位
    /// </summary>
    [fastCSharp.code.cSharp.webView(IsPage = false, IsPool = true)]
    partial class jobEdit : examPermissionView<jobEdit>
    {
        /// <summary>
        /// 工作职位
        /// </summary>
        [fastCSharp.emit.webView.clearMember]
        private diantou.examDataAccess.enterpriseJob job;
        /// <summary>
        /// 工作职位
        /// </summary>
        [fastCSharp.emit.webView.clearMember]
        private diantou.examDataAccess.enterpriseJob description;
        /// <summary>
        /// 是否修改职位名称
        /// </summary>
        private bool isReworkName
        {
            get { return job.Id == 0; }
        }
        /// <summary>
        /// 是否修改简略说明
        /// </summary>
        private bool isReworkRemark
        {
            get { return job.Id == 0; }
        }
        /// <summary>
        /// 是否修改报名链接
        /// </summary>
        private bool isReworkLink
        {
            get { return job.Id == 0; }
        }
        /// <summary>
        /// 是否修改工作描述
        /// </summary>
        private bool isReworkDescription
        {
            get { return job.Id == 0; }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="jobId"></param>
        /// <returns></returns>
        private bool loadView(int jobId)
        {
            if (jobId == 0)
            {
                job = description = diantou.examDataAccess.enterpriseJob.NullJob;
                return true;
            }
            job = diantou.examDataAccess.tcpCall.enterpriseJob.get(jobId, currentUserId);
            if (job != null)
            {
                description = diantou.examDataAccess.tcpCall.enterpriseJob.GetDescription(jobId);
                return true;
            }
            AjaxResponse(webConfig.NotFound404);
            return false;
        }
    }
}
